<template>
	<!-- 我的下级页面 -->
	<view class="subordinate">
		<view class="flex1" style="border-bottom: 2rpx solid #eee;padding-bottom: 30rpx;">
			<view class="subordinate_title">团队总收益</view>
			<view>{{count}}</view>
		</view>
		<view class="subordinate_item" v-for="(item,index) in list" :key="index">
			<view class="flex1">
				<view class="subordinate_label">{{item.nickName}}</view>
				<view class="subordinate_phone">{{item.phone}}</view>
			</view>
			<view class="subordinate_income">成员收益  {{item.money}}</view>
			<view  class="subordinate_income">团队收益 {{item.moneySum}}</view>
			<view>{{item.createTime}}</view>
		</view>
		
		<view v-if="list.length==0" class="nolist">当前无数据</view>
	</view>
</template>

<script setup>
	import { computed ,ref,reactive,toRefs,onMounted} from 'vue';
	import { onLoad,onShow, onPageScroll, onPullDownRefresh } from '@dcloudio/uni-app';
	import sheep from '@/sheep';
	
	const list=ref()
	list.value=[]
	const count=ref()
	
	
	onLoad(()=>{
		getUserTree()
	})
	
	
	const  getUserTree=()=>{
		sheep.$api.login.userInviteTree().then(res=>{
			console.log(res);
			list.value=res.data.list
			count.value=res.data.totalTeamMoney
		})
	}
</script>

<style lang="scss" scoped>
	page{
		padding:20rpx;
	}
	
	.flex1{
		display: flex;
		align-items: center;
		justify-content: space-between;
	}
	.subordinate_title{
		font-size: 30rpx;
		font-weight: 700;
	}
	.nolist{
		margin: 200rpx 0;
		text-align: center;
	}
	.subordinate{
		padding: 30rpx;
		background-color: #fff;
		border-radius: 15rpx;
	}
	
	.subordinate_item{
		font-size: 26rpx;
		color: #c2c2c2;
		border-bottom: 2rpx solid #eee;
		padding:20rpx;
		
		.subordinate_label{
			color: #000;
			font-size: 34rpx;
			font-weight: 700;
		}
		
		.subordinate_phone{
			font-size: 28rpx;
			margin: 10rpx 0;
		}
		
		.subordinate_income{
			margin:10rpx 0;
		}
	}
</style>